﻿/*
 * 物料信息显示
 * 参数   交易码：trancode=12136
 * 
 */

package org.ccams.tran;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.ccams.domain.TMateriel;
import org.ccams.util.ConvertUtil;
import org.ccams.util.PageParameter;

public class Tran12136 extends AbstractJsonTran {

	@SuppressWarnings("unchecked")
	public void buildJSONObject(Map model, JSONObject json,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		int limit = Integer.parseInt(request.getParameter("limit"));
		int start = Integer.parseInt(request.getParameter("start"));
		String spec = request.getParameter("spec");
		String condition = request.getParameter("condition");
		PageParameter page = new PageParameter();
		page.setLimit(limit);
		page.setStart(start);
		page.setSpec(spec);
		page.setCondition(condition);
		
		List<TMateriel> list = getCcamsService().getTmaterielDao().getTMaterielByPage(page);
		int count = getCcamsService().getTmaterielDao().getCount(page);

        json.putAll(ConvertUtil.objectcollect2json(list, count));
	}
}
